package com.zxkj.domain.mapper;

import com.zxkj.domain.entity.SciDoc;
import com.zxkj.domain.entity.SciDocCopy;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by Administrator on 2017/7/12.
 */
public interface SciDocCopyRepository extends JpaRepository<SciDocCopy, String> {

    @Query(value = "SELECT * FROM sci_doc_copy WHERE ut = ?1 limit 1", nativeQuery = true)
    SciDocCopy findByUT(String ut);

    @Query(value = "select * from sci_doc_copy where abc_id=? and num>=? and num<=?", nativeQuery = true)
    List<SciDocCopy> findAll(Integer abcId, Integer startNum, Integer endNum);

    @Query(value = "select * from sci_doc_copy where num>=? and num<=?", nativeQuery = true)
    List<SciDocCopy> findAll(Integer startNum, Integer endNum);

}
